Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix secret cleanup issue #1487

Merged

Conversation

savitaashture
Copy link
Member

When max-keep-runs is exceeded, The GitHub basic auth secret for the latest pipelineRun is deleted.

For example, if max-keep-runs is set to 1, kick off a pipelineRun. when it's done, kick off another instance of the same pipelineRun. When the second pipelineRun is done and pac performs a cleanup to delete the first pipelineRun, the deletion is proper for first pipelinerun, but it also deletes the secret associated with the second pipeline run

Signed-off-by: Savita Ashture sashture@redhat.com

Changes

Submitter Checklist

  • 📝 A good commit message is important for other reviewers to understand the context of your change. Please refer to How to Write a Git Commit Message for more details how to write beautiful commit messages. We rather have the commit message in the PR body and the commit message instead of an external website.
  • ♽ Run make test before submitting a PR (ie: with pre-commit, no need to waste CPU cycle on CI. (or even better install pre-commit and do pre-commit install in the root of this repo).
  • ✨ We heavily rely on linters to get our code clean and consistent, please ensure that you have run make lint before submitting a PR. The markdownlint error can get usually fixed by running make fix-markdownlint (make sure it's installed first)
  • 📖 If you are adding a user facing feature or make a change of the behavior, please verify that you have documented it
  • 🧪 100% coverage is not a target but most of the time we would rather have a unit test if you make a code change.
  • 🎁 If that's something that is possible to do please ensure to check if we can add a e2e test.
  • 🔎 If there is a flakiness in the CI tests then don't necessary ignore it, better get the flakyness fixed before merging or if that's not possible there is a good reason to bypass it. (token rate limitation may be a good reason to skip).

@savitaashture
Copy link
Member Author

adding e2e

@chmouel
Copy link
Member

chmouel commented Oct 27, 2023

LGTM

feel free to merge after fixing the linters, thanks

(except if you want to add e2e as well then it's even better!)

@codecov
Copy link

codecov bot commented Oct 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3ccb287) 61.63% compared to head (20c2bc6) 61.63%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1487   +/-   ##
=======================================
  Coverage   61.63%   61.63%           
=======================================
  Files         138      138           
  Lines       10292    10292           
=======================================
  Hits         6343     6343           
  Misses       3436     3436           
  Partials      513      513           
Files Coverage Δ
pkg/kubeinteraction/cleanups.go 70.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@savitaashture savitaashture force-pushed the fix-secret-cleanup-issue branch 4 times, most recently from 78c1036 to 128fe39 Compare October 27, 2023 11:13
When max-keep-runs is exceeded, The GitHub basic auth secret
for the latest pipelineRun is deleted.

For example, if max-keep-runs is set to 1, kick off a pipelineRun.
when it's done, kick off another instance of the same pipelineRun.
When the second pipelineRun is done and pac performs a cleanup
to delete the first pipelineRun, the deletion is proper for first
pipelinerun, but it also deletes the secret associated
with the second pipeline run

Signed-off-by: Savita Ashture <sashture@redhat.com>
@savitaashture savitaashture force-pushed the fix-secret-cleanup-issue branch from 128fe39 to 20c2bc6 Compare October 27, 2023 13:08
@savitaashture
Copy link
Member Author

@chmouel can we merge now

@chmouel chmouel merged commit 37ec9a9 into openshift-pipelines:main Oct 27, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants